<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <title>EasyOTP</title>
  <link rel="stylesheet" href="popup.css">
</head>
<body>
  <div id="app">
    <div class="header-container">
      <div class="header-left">
        <img src="icons/icon16.png" alt="logo" style="width:22px;height:22px;vertical-align:middle;" />
        <h2 style="margin:0;font-size:1.4em;color:#2c3e50;">EasyOTP</h2>
      </div>
      <button id="add-account-btn" class="add-btn">＋ 添加账户</button>
    </div>
    <div id="account-list" class="account-list"></div>
    <div id="otp-display"></div>
  </div>
  <div id="modal-mask" class="modal-mask" style="display:none;">
    <div class="modal">
      <h3>添加账户</h3>
      <form id="add-account-form">
        <input type="text" id="account-name" placeholder="账户名称" required />
        <input type="text" id="account-secret" placeholder="密钥（Secret）" required />
        <select id="account-type">
          <option value="TOTP">TOTP（推荐）</option>
          <option value="HOTP">HOTP</option>
        </select>
        <div style="margin:8px 0;display:flex;align-items:center;gap:10px;">
          <input type="file" id="qrcode-file" accept="image/*" style="display:none;" />
          <button type="button" id="qrcode-file-btn" class="secondary-btn" style="flex:1;">选择二维码</button>
          <span id="qrcode-file-name" style="font-size:0.95em;color:#888;"></span>
        </div>
        <div class="modal-actions" style="display:flex;justify-content:flex-end;gap:10px;">
          <button type="submit" class="primary-btn" style="padding:8px 18px;font-size:1em;max-width:120px;">保存</button>
          <button type="button" id="cancel-btn" class="secondary-btn" style="padding:8px 18px;font-size:1em;">取消</button>
        </div>
      </form>
    </div>
  </div>
  <script src="libs/otplib-browser.js"></script>
  <script src="libs/jsQR.min.js"></script>
  <script src="qrcode.js"></script>
  <script src="popup.js"></script>
</body>
</html> 